﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:CodePlex.Silverlight.Controls;assembly=CodePlex.Silverlight.Controls">

    <Style TargetType="local:NavigationItem" >
        <Setter Property="IsEnabled" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NavigationItem">
                    <Grid x:Name="RootElement" >
                        <Grid.Resources>
                            <Storyboard x:Key="Normal State">
                                <ColorAnimation Storyboard.TargetName="GradientStop1" Storyboard.TargetProperty="Color" To="#F3F3F3" Duration="0:0:0.1" />
                                <ColorAnimation Storyboard.TargetName="GradientStop2" Storyboard.TargetProperty="Color" To="#EBEBEB" Duration="0:0:0.1" />
                                <ColorAnimation Storyboard.TargetName="GradientStop3" Storyboard.TargetProperty="Color" To="#DDDDDD" Duration="0:0:0.1" />
                                <ColorAnimation Storyboard.TargetName="GradientStop4" Storyboard.TargetProperty="Color" To="#CDCDCD" Duration="0:0:0.1" />
                                <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To="1" />
                            </Storyboard>
                            <Storyboard x:Key="MouseOver State">
                                <ColorAnimation Storyboard.TargetName="GradientStop1" Storyboard.TargetProperty="Color" To="#EAF6FD" Duration="0:0:0.1" />
                                <ColorAnimation Storyboard.TargetName="GradientStop2" Storyboard.TargetProperty="Color" To="#D9F0FC" Duration="0:0:0.1" />
                                <ColorAnimation Storyboard.TargetName="GradientStop3" Storyboard.TargetProperty="Color" To="#BEE6FD" Duration="0:0:0.1" />
                                <ColorAnimation Storyboard.TargetName="GradientStop4" Storyboard.TargetProperty="Color" To="#A7D9F5" Duration="0:0:0.1" />
                                <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To="1" />
                            </Storyboard>
                            <Storyboard x:Key="Selected State">
                                <ColorAnimation Storyboard.TargetName="GradientStop1" Storyboard.TargetProperty="Color" To="#FFF3DB" Duration="0:0:0.1" />
                                <ColorAnimation Storyboard.TargetName="GradientStop2" Storyboard.TargetProperty="Color" To="#FFD3A8" Duration="0:0:0.1" />
                                <ColorAnimation Storyboard.TargetName="GradientStop3" Storyboard.TargetProperty="Color" To="#FFCD70" Duration="0:0:0.1" />
                                <ColorAnimation Storyboard.TargetName="GradientStop4" Storyboard.TargetProperty="Color" To="#FFBC14" Duration="0:0:0.1" />
                                <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To="1" />
                            </Storyboard>
                            <Storyboard x:Key="Disabled State">
                                <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Opacity" To="0.5" />
                            </Storyboard>
                        </Grid.Resources>
                        <Border x:Name="NavItemBorderElement" BorderBrush="Black" BorderThickness="1">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                    <GradientStop x:Name="GradientStop1" Color="#F3F3F3" Offset="0.15" />
                                    <GradientStop x:Name="GradientStop2" Color="#EBEBEB" Offset=".5" />
                                    <GradientStop x:Name="GradientStop3" Color="#DDDDDD" Offset=".5" />
                                    <GradientStop x:Name="GradientStop4" Color="#CDCDCD" Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                            <ContentControl x:Name="HeaderElement" Content="{TemplateBinding Header}" Margin="6,1,6,1" />
                        </Border>
                      </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:NavigationPane" >    
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NavigationPane">
                    <Grid x:Name="RootElement" >
                        <Grid.Resources>
                            <!-- Brushes -->
                            <SolidColorBrush x:Key="BorderBrush" Color="#FF000000" />
                            <SolidColorBrush x:Key="DisabledBrush" Color="#A5FFFFFF" />
                            <!-- Storyboards -->
                            <Storyboard x:Key="Normal State" />
                            <Storyboard x:Key="Disabled State">
                                <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="Disabled" Storyboard.TargetProperty="Opacity" To="1" />
                            </Storyboard>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="25" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>                       
                            <Border x:Name="ContentHeaderBorderElement" Background="White" BorderBrush="{StaticResource BorderBrush}" BorderThickness="1" Grid.Column="0" Grid.Row="0" MinHeight="10" MinWidth="10">
                                <TextBlock x:Name="ContentHeaderElement"  Text="{TemplateBinding SelectedHeader}"  HorizontalAlignment="Center"/>
                            </Border> 
                        <Border x:Name="ContentBorderElement" Background="White" BorderBrush="{StaticResource BorderBrush}" BorderThickness="1" Grid.Column="0" Grid.Row="1" MinHeight="10" MinWidth="10">
                            <Grid x:Name="ContentHostElement" Background="White" Margin="4,4,4,4"  HorizontalAlignment="Stretch"/>
                        </Border>                        
                        <StackPanel x:Name="NavigationControlElement" Grid.Row="2" Canvas.ZIndex="1" VerticalAlignment="Bottom"></StackPanel>                        
                        <Rectangle x:Name="Disabled" Canvas.ZIndex="1" Grid.Column="0" Grid.Row="0"  Grid.RowSpan="3" IsHitTestVisible="False" Fill="{StaticResource DisabledBrush}" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>